package org.trinity.netdisk.service;

import org.springframework.http.HttpHeaders;
import org.trinity.netdisk.enums.ShareDays;
import org.trinity.netdisk.util.ResponseWrapper;
import org.trinity.netdisk.vo.shareFile.ShareFileLinkedCodeVO;
import org.trinity.netdisk.vo.shareFile.ShareFileVO;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

public interface IShareFileService {
    /**
     * 获取分享链接
     * @param userId  用户id
     * @param userFileId 用户文件表id
     * @param shareDays 分享天数
     * @return
     */
    ShareFileLinkedCodeVO getShareFileUrl(Long userId, Long userFileId, ShareDays shareDays);

    /**
     * 根据url 解析文件信息
     * @param shareFileId
     * @return
     */
    ResponseWrapper getShareFileDetailInfo(String shareFileId);

    /**
     * 验证验证码
     * @param shareFileId
     * @param checkCode
     * @return
     */
    void checkShareCode(String shareFileId, String checkCode);

    void download(HttpHeaders httpHeaders, HttpServletResponse response, String shareFileId, String checkCode) throws IOException;

    List<ShareFileVO> selectShareVO(Long userId);

    void delete(Long userId, Long id);
}
